package cn.lili.modules.member.entity.dos;

import cn.lili.mybatis.model.BaseStandardEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serial;
import java.util.Date;

@EqualsAndHashCode(callSuper = true)
@Data
@TableName("li_red_pack_task")
@ApiModel(value = "红包任务配置")
public class RedPackTask extends BaseStandardEntity {

    @Serial
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "任务名称")
    private String taskName;

    @ApiModelProperty(value = "任务状态：0关闭、1正常")
    private String status;

    @ApiModelProperty(value = "任务类型：0广告任务、1邀新任务")
    private Integer taskType;

    @ApiModelProperty(value = "每日任务次数限制")
    private Integer everydayCount;

    @ApiModelProperty(value = "红包任务奖励")
    private Integer redPackCount;

    @ApiModelProperty(value = "完成任务条件：邀新人数，观看视频时长")
    private Integer conditions;

    @ApiModelProperty(value = "会员用户观看广告任务次数")
    private Integer vipCount;

    @ApiModelProperty(value = "任务开始时间", required = true)
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @Field(type = FieldType.Date, pattern = "yyyy-MM-dd HH:mm:ss || yyyy-MM-dd || yyyy/MM/dd HH:mm:ss|| yyyy/MM/dd ||epoch_millis")
    private Date startTime;

    @ApiModelProperty(value = "任务结束时间", required = true)
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @Field(type = FieldType.Date, pattern = "yyyy-MM-dd HH:mm:ss || yyyy-MM-dd || yyyy/MM/dd HH:mm:ss|| yyyy/MM/dd ||epoch_millis")
    private Date endTime;

    @ApiModelProperty(value = "是否vip任务")
    private Integer isVipTask;

    @ApiModelProperty(value = "用户红包任务状态:0未完成，1已完成，2待领取红包")
    @TableField(exist = false)
    private Integer taskStatus;

    @ApiModelProperty(value = "用户任务ID")
    @TableField(exist = false)
    private String userTaskId;
}
